<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>login.jsp</title>
<script src="commonjs/jquery-1.11.0.min.js" type="text/javascript" charset="utf-8"></script>
<script src="commonjs/vue.min.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div id="login" >
动态绑定：{{username}}</br>
账号：<input type="text" v-model="username"></br>
密码：<input type="password" v-model="password"></br>
<button id="sent">点击</button></br>
提示：{{msg}}</br>
${mssg}</br>
</div>
</body>
<script>
 var login = new Vue({
	 el: '#login',
	 data:{
		 username:'',
		 password:'',
		 msg:''
	 }
 });


 
 $(function(){
	    $('#sent').click(function(){
	    	debugger
	         $.ajax({
	             type: "post",
	             url: "login.do",
	             data: {username:login.username, password:login.password},
	             dataType: "json",
	             
	             success: function(data){
	                         console.log(data)
	                         login.msg = data.msg;
	                         if(data.url != null)
	                        	 window.location.href=data.url;
	                      }
	         });
	    });
	});

</script>
</html>